package FSMDemo.entity
{
	
	import FSMDemo.Assets;
	import FSMDemo.entity.Harvester.Harvester;
	import FSMDemo.entity.Harvester.HarvesterParams;
	import FSMDemo.entity.Harvester.HarvesterRenderer;
	import FSMDemo.entity.mine.Mine;
	import FSMDemo.entity.mine.MineRenderer;
	import FSMDemo.entity.mine.params.MineParams;
	
	import com.cheezeworld.GameFactory;
	import com.cheezeworld.entity.EntityParams;
	import com.cheezeworld.entity.MovingEntity;
	import com.cheezeworld.rendering.BitmapRenderer;
	
	public class EntityTypes
	{		
		public static function register( a_gameFactory:GameFactory ) : void
		{
			var hParams:HarvesterParams;
			var eParams:EntityParams;
			var mParams:MineParams;
			
			eParams = new EntityParams( { radius:50 } );
			eParams.type = "Base";
			eParams.customClass = Building;
			eParams.rendererClass = BitmapRenderer;
			eParams.rendererData.bitmapData = new Assets.Base().bitmapData;
			a_gameFactory.registerEntityType( eParams );
			
			mParams = new MineParams( { startingMinerals:200, radius:75 } );
			mParams.type = "Mine";
			mParams.startingMinerals = 10;
			mParams.customClass = Mine;
			mParams.rendererClass = MineRenderer;
			mParams.rendererData.bitmapData = new Assets.GoldMine().bitmapData;
			a_gameFactory.registerEntityType( mParams );
			
			hParams = new HarvesterParams( { neighborDistance:100, maxSpeed:120, maxAcceleration:5, damping:.98, radius:15, maxTurnRate:360 } );
			hParams.type = "Harvester";
			hParams.layer = 2;
			hParams.capacity = 5;
			hParams.harvestPerSecond = 1;
			hParams.customClass = Harvester;
			hParams.rendererClass = HarvesterRenderer;
			hParams.rendererData.sprite = Assets.Harvester;
			hParams.boundsBehavior = MovingEntity.BOUNDS_WRAP;
			a_gameFactory.registerEntityType( hParams );
		}

	}
}